package com.wxm.dom4j.base;

import com.wxm.dom4j.base.Xml;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;

/**
 * <p>
 *      Xml字符串解析
 * </p>
 *
 * @author: wxm
 * @Date: 2021/9/28
 */
public class XmlString implements Xml {
    /**
     * xml文本
     */
    public String xmlText;

    public XmlString(String xmlText) {
        this.xmlText = xmlText;
    }

    @Override
    public Document getDocument() throws Exception {
        return DocumentHelper.parseText(this.xmlText);
    }
}
